home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / var / lib / dpkg / info / dbus.postinst < prev    next >
Encoding:
Text File  |  2007-03-08  |  1.9 KB  |  59 lines

  1. #!/bin/sh
  2. # -*- coding: utf-8 -*-
  3. # Post-installation script for D-BUS
  4. # Copyright ┬⌐ 2003 Colin Walters <walters@debian.org>
  5. # Copyright ┬⌐ 2006 Sjoerd Simons <sjoerd@debian.org>
  6.  
  7. set -e
  8.  
  9. MESSAGEUSER=messagebus
  10. MESSAGEHOME=/var/run/dbus
  11.  
  12.  
  13. chgrp "$MESSAGEUSER" "$MESSAGEHOME" 2>/dev/null || addgroup --system "$MESSAGEUSER"
  14. chown "$MESSAGEUSER"."$MESSAGEUSER" "$MESSAGEHOME" 2>/dev/null || \
  15.     adduser --system --home "$MESSAGEHOME" --no-create-home --disabled-password --ingroup "$MESSAGEUSER" "$MESSAGEUSER"
  16.  
  17. # fix rc symlink priorities for upgrades from older versions
  18. if [ "$1" = configure ] && dpkg --compare-versions "$2" lt-nl 1.0.2-1ubuntu3; then
  19.     echo "Fixing up startup script priorities..."
  20.     for l in 2 3 4 5; do
  21.         old=/etc/rc$l.d/S20dbus
  22.         new=/etc/rc$l.d/S12dbus
  23.         if [ -e $old ] && ! [ -e $new ]; then
  24.             mv $old $new
  25.         fi
  26.     done
  27. fi
  28.  
  29. # Do not restart dbus on upgrades, only on fresh installations
  30. # But do reload it so the machine-id can be generated
  31. if [ "$1" = "configure" ]; then
  32.     if [ -e /var/run/dbus/pid ] && 
  33.       ps --no-heading -p $(cat /var/run/dbus/pid) > /dev/null; then
  34.         # trigger an update notification which recommends to reboot
  35.         [ -x /usr/share/update-notifier/notify-reboot-required ] && \
  36.             /usr/share/update-notifier/notify-reboot-required || true
  37.         if [ -x "/etc/init.d/dbus" ]; then
  38.           if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
  39.                 invoke-rc.d dbus reload || true
  40.           else
  41.                 /etc/init.d/dbus reload || true
  42.           fi
  43.         fi
  44.         exit 0
  45.     fi
  46. fi
  47.  
  48. # Automatically added by dh_installinit
  49. if [ -x "/etc/init.d/dbus" ]; then
  50.     update-rc.d dbus multiuser 12 20 >/dev/null
  51.     if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
  52.         invoke-rc.d dbus start || exit $?
  53.     else
  54.         /etc/init.d/dbus start || exit $?
  55.     fi
  56. fi
  57. # End automatically added section
  58.  
  59.